<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.cmccsi.mapper.qxuserDtoMapper" >
  <resultMap id="BaseResultMap" type="com.cmccsi.entity.qxuserDto" >
    <id column="id" property="id" jdbcType="BIGINT" />
    <result column="user_name" property="userName" jdbcType="VARCHAR" />
    <result column="auth" property="auth" jdbcType="VARCHAR" />
    <result column="display_name" property="displayName" jdbcType="VARCHAR" />
    <result column="complete_spellings" property="completeSpellings" jdbcType="VARCHAR" />
    <result column="initials" property="initials" jdbcType="VARCHAR" />
    <result column="gender" property="gender" jdbcType="BIT" />
    <result column="mobile_phone" property="mobilePhone" jdbcType="CHAR" />
    <result column="email" property="email" jdbcType="VARCHAR" />
    <result column="fax" property="fax" jdbcType="VARCHAR" />
    <result column="office_phone" property="officePhone" jdbcType="VARCHAR" />
    <result column="office_exten" property="officeExten" jdbcType="VARCHAR" />
    <result column="domainid" property="domainid" jdbcType="VARCHAR" />
    <result column="create_time" property="createTime" jdbcType="TIMESTAMP" />
    <result column="update_time" property="updateTime" jdbcType="TIMESTAMP" />
    <result column="permissionid" property="permissionid" jdbcType="INTEGER" />
    <result column="sip_exten" property="sipExten" jdbcType="VARCHAR" />
    <result column="urllist" property="urllist" jdbcType="VARCHAR" />
    <result column="cyloginflag" property="cyloginflag" jdbcType="INTEGER" />
  </resultMap>
  <resultMap id="ResultMapWithBLOBs" type="com.cmccsi.entity.qxuserDto" extends="BaseResultMap" >
    <result column="portrait" property="portrait" jdbcType="LONGVARCHAR" />
  </resultMap>
  <sql id="Base_Column_List" >
    id, user_name, auth, display_name, complete_spellings, initials, gender, mobile_phone, 
    email, fax, office_phone, office_exten, domainid, create_time, update_time, permissionid, 
    sip_exten, urllist, cyloginflag
  </sql>
  <sql id="Blob_Column_List" >
    portrait
  </sql>
  <select id="selectByPrimaryKey" resultMap="ResultMapWithBLOBs" parameterType="java.lang.Long" >
    select 
    <include refid="Base_Column_List" />
    ,
    <include refid="Blob_Column_List" />
    from qxuser
    where id = #{id,jdbcType=BIGINT}
  </select>
  <select id="selectByModile" resultMap="ResultMapWithBLOBs" parameterType="java.lang.String" >
    select 
    <include refid="Base_Column_List" />
    ,
    <include refid="Blob_Column_List" />
    from qxuser
    where mobile_phone = #{mobilePhone,jdbcType=CHAR}
  </select>  
  
  <select id="selectByModileOrUsernameAndDomainId" resultMap="ResultMapWithBLOBs" >
    select 
    <include refid="Base_Column_List" />
    ,
    <include refid="Blob_Column_List" />
    from qxuser
    where  domainid= #{0} And (user_name= #{1} or mobile_phone=  #{2})
  </select>
    <delete id="deleteByPrimaryKey" parameterType="java.lang.Long" >
    delete from qxuser
    where id = #{id,jdbcType=BIGINT}
  </delete>
  
  <delete id="deleteByDomainId" parameterType="java.lang.String" >
    delete from qxuser
    where domainid = #{domainid,jdbcType=VARCHAR}
  </delete>
  
 <delete id="deleteByMobile" parameterType="java.lang.String" >
    delete from qxuser
    where mobile_phone = #{mobilePhone,jdbcType=VARCHAR}
  </delete>
  
  
  <insert id="insert" parameterType="com.cmccsi.entity.qxuserDto" >
    insert into qxuser (id, user_name, auth, 
      display_name, complete_spellings, initials, 
      gender, mobile_phone, email, 
      fax, office_phone, office_exten, 
      domainid, create_time, update_time, 
      permissionid, sip_exten, urllist, 
      cyloginflag, portrait)
    values (#{id,jdbcType=BIGINT}, #{userName,jdbcType=VARCHAR}, #{auth,jdbcType=VARCHAR}, 
      #{displayName,jdbcType=VARCHAR}, #{completeSpellings,jdbcType=VARCHAR}, #{initials,jdbcType=VARCHAR}, 
      #{gender,jdbcType=BIT}, #{mobilePhone,jdbcType=CHAR}, #{email,jdbcType=VARCHAR}, 
      #{fax,jdbcType=VARCHAR}, #{officePhone,jdbcType=VARCHAR}, #{officeExten,jdbcType=VARCHAR}, 
      #{domainid,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}, 
      #{permissionid,jdbcType=INTEGER}, #{sipExten,jdbcType=VARCHAR}, #{urllist,jdbcType=VARCHAR}, 
      #{cyloginflag,jdbcType=INTEGER}, #{portrait,jdbcType=LONGVARCHAR})
  </insert>
  <insert id="insertSelective" parameterType="com.cmccsi.entity.qxuserDto" >
    insert into qxuser
    <trim prefix="(" suffix=")" suffixOverrides="," >
      <if test="id != null" >
        id,
      </if>
      <if test="userName != null" >
        user_name,
      </if>
      <if test="auth != null" >
        auth,
      </if>
      <if test="displayName != null" >
        display_name,
      </if>
      <if test="completeSpellings != null" >
        complete_spellings,
      </if>
      <if test="initials != null" >
        initials,
      </if>
      <if test="gender != null" >
        gender,
      </if>
      <if test="mobilePhone != null" >
        mobile_phone,
      </if>
      <if test="email != null" >
        email,
      </if>
      <if test="fax != null" >
        fax,
      </if>
      <if test="officePhone != null" >
        office_phone,
      </if>
      <if test="officeExten != null" >
        office_exten,
      </if>
      <if test="domainid != null" >
        domainid,
      </if>
      <if test="createTime != null" >
        create_time,
      </if>
      <if test="updateTime != null" >
        update_time,
      </if>
      <if test="permissionid != null" >
        permissionid,
      </if>
      <if test="sipExten != null" >
        sip_exten,
      </if>
      <if test="urllist != null" >
        urllist,
      </if>
      <if test="cyloginflag != null" >
        cyloginflag,
      </if>
      <if test="portrait != null" >
        portrait,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides="," >
      <if test="id != null" >
        #{id,jdbcType=BIGINT},
      </if>
      <if test="userName != null" >
        #{userName,jdbcType=VARCHAR},
      </if>
      <if test="auth != null" >
        #{auth,jdbcType=VARCHAR},
      </if>
      <if test="displayName != null" >
        #{displayName,jdbcType=VARCHAR},
      </if>
      <if test="completeSpellings != null" >
        #{completeSpellings,jdbcType=VARCHAR},
      </if>
      <if test="initials != null" >
        #{initials,jdbcType=VARCHAR},
      </if>
      <if test="gender != null" >
        #{gender,jdbcType=BIT},
      </if>
      <if test="mobilePhone != null" >
        #{mobilePhone,jdbcType=CHAR},
      </if>
      <if test="email != null" >
        #{email,jdbcType=VARCHAR},
      </if>
      <if test="fax != null" >
        #{fax,jdbcType=VARCHAR},
      </if>
      <if test="officePhone != null" >
        #{officePhone,jdbcType=VARCHAR},
      </if>
      <if test="officeExten != null" >
        #{officeExten,jdbcType=VARCHAR},
      </if>
      <if test="domainid != null" >
        #{domainid,jdbcType=VARCHAR},
      </if>
      <if test="createTime != null" >
        #{createTime,jdbcType=TIMESTAMP},
      </if>
      <if test="updateTime != null" >
        #{updateTime,jdbcType=TIMESTAMP},
      </if>
      <if test="permissionid != null" >
        #{permissionid,jdbcType=INTEGER},
      </if>
      <if test="sipExten != null" >
        #{sipExten,jdbcType=VARCHAR},
      </if>
      <if test="urllist != null" >
        #{urllist,jdbcType=VARCHAR},
      </if>
      <if test="cyloginflag != null" >
        #{cyloginflag,jdbcType=INTEGER},
      </if>
      <if test="portrait != null" >
        #{portrait,jdbcType=LONGVARCHAR},
      </if>
    </trim>
  </insert>
  <update id="updateByPrimaryKeySelective" parameterType="com.cmccsi.entity.qxuserDto" >
    update qxuser
    <set >
      <if test="userName != null" >
        user_name = #{userName,jdbcType=VARCHAR},
      </if>
      <if test="auth != null" >
        auth = #{auth,jdbcType=VARCHAR},
      </if>
      <if test="displayName != null" >
        display_name = #{displayName,jdbcType=VARCHAR},
      </if>
      <if test="completeSpellings != null" >
        complete_spellings = #{completeSpellings,jdbcType=VARCHAR},
      </if>
      <if test="initials != null" >
        initials = #{initials,jdbcType=VARCHAR},
      </if>
      <if test="gender != null" >
        gender = #{gender,jdbcType=BIT},
      </if>
      <if test="mobilePhone != null" >
        mobile_phone = #{mobilePhone,jdbcType=CHAR},
      </if>
      <if test="email != null" >
        email = #{email,jdbcType=VARCHAR},
      </if>
      <if test="fax != null" >
        fax = #{fax,jdbcType=VARCHAR},
      </if>
      <if test="officePhone != null" >
        office_phone = #{officePhone,jdbcType=VARCHAR},
      </if>
      <if test="officeExten != null" >
        office_exten = #{officeExten,jdbcType=VARCHAR},
      </if>
      <if test="domainid != null" >
        domainid = #{domainid,jdbcType=VARCHAR},
      </if>
      <if test="createTime != null" >
        create_time = #{createTime,jdbcType=TIMESTAMP},
      </if>
      <if test="updateTime != null" >
        update_time = #{updateTime,jdbcType=TIMESTAMP},
      </if>
      <if test="permissionid != null" >
        permissionid = #{permissionid,jdbcType=INTEGER},
      </if>
      <if test="sipExten != null" >
        sip_exten = #{sipExten,jdbcType=VARCHAR},
      </if>
      <if test="urllist != null" >
        urllist = #{urllist,jdbcType=VARCHAR},
      </if>
      <if test="cyloginflag != null" >
        cyloginflag = #{cyloginflag,jdbcType=INTEGER},
      </if>
      <if test="portrait != null" >
        portrait = #{portrait,jdbcType=LONGVARCHAR},
      </if>
    </set>
    where id = #{id,jdbcType=BIGINT}
  </update>
  <update id="updateByPrimaryKeyWithBLOBs" parameterType="com.cmccsi.entity.qxuserDto" >
    update qxuser
    set user_name = #{userName,jdbcType=VARCHAR},
      auth = #{auth,jdbcType=VARCHAR},
      display_name = #{displayName,jdbcType=VARCHAR},
      complete_spellings = #{completeSpellings,jdbcType=VARCHAR},
      initials = #{initials,jdbcType=VARCHAR},
      gender = #{gender,jdbcType=BIT},
      mobile_phone = #{mobilePhone,jdbcType=CHAR},
      email = #{email,jdbcType=VARCHAR},
      fax = #{fax,jdbcType=VARCHAR},
      office_phone = #{officePhone,jdbcType=VARCHAR},
      office_exten = #{officeExten,jdbcType=VARCHAR},
      domainid = #{domainid,jdbcType=VARCHAR},
      create_time = #{createTime,jdbcType=TIMESTAMP},
      update_time = #{updateTime,jdbcType=TIMESTAMP},
      permissionid = #{permissionid,jdbcType=INTEGER},
      sip_exten = #{sipExten,jdbcType=VARCHAR},
      urllist = #{urllist,jdbcType=VARCHAR},
      cyloginflag = #{cyloginflag,jdbcType=INTEGER},
      portrait = #{portrait,jdbcType=LONGVARCHAR}
    where id = #{id,jdbcType=BIGINT}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.cmccsi.entity.qxuserDto" >
    update qxuser
    set user_name = #{userName,jdbcType=VARCHAR},
      auth = #{auth,jdbcType=VARCHAR},
      display_name = #{displayName,jdbcType=VARCHAR},
      complete_spellings = #{completeSpellings,jdbcType=VARCHAR},
      initials = #{initials,jdbcType=VARCHAR},
      gender = #{gender,jdbcType=BIT},
      mobile_phone = #{mobilePhone,jdbcType=CHAR},
      email = #{email,jdbcType=VARCHAR},
      fax = #{fax,jdbcType=VARCHAR},
      office_phone = #{officePhone,jdbcType=VARCHAR},
      office_exten = #{officeExten,jdbcType=VARCHAR},
      domainid = #{domainid,jdbcType=VARCHAR},
      create_time = #{createTime,jdbcType=TIMESTAMP},
      update_time = #{updateTime,jdbcType=TIMESTAMP},
      permissionid = #{permissionid,jdbcType=INTEGER},
      sip_exten = #{sipExten,jdbcType=VARCHAR},
      urllist = #{urllist,jdbcType=VARCHAR},
      cyloginflag = #{cyloginflag,jdbcType=INTEGER}
    where id = #{id,jdbcType=BIGINT}
  </update>
</mapper>